
#include "FlyweightB.h"
#include <utility>
#include <iostream>

using namespace npFlyweight;
using namespace std;


FlyweightB::FlyweightB() : Flyweight() // class inheritance
{
    //To initialize data member;
}

FlyweightB::~FlyweightB()
{
    //To delete dynamic data member
}

FlyweightB::FlyweightB(const FlyweightB& cpy) : Flyweight(cpy) // class inheritance
{
    //To copy data member
}

FlyweightB& FlyweightB::operator=(const FlyweightB& asn)
{
    if (this == &asn)
    {
        return *this;
    }
    else
    {
        //To invoke base class operator=
        Flyweight::operator=(asn);
        //To assign data member, note to delete dynamic member if exists.
        
        return *this;
    }
}

FlyweightB::FlyweightB(FlyweightB&& mov) noexcept : Flyweight(move(mov)) // class inheritance
{
    //to move data
}

FlyweightB& FlyweightB::operator=(FlyweightB&& mva) noexcept
{
    if (this == &mva)
    {
        return *this;
    }
    else
    {
        //to inform base class to move data
        Flyweight::operator=(move(mva));
        // to move data
        
        return *this;
    }
}

FlyweightB* FlyweightB::clone() const
{
    //return new
    return new FlyweightB(*this);
}

//other constructors

//public methods
void FlyweightB::operate(int n) throw()
{
    cout << "Flyweight B: " << n << endl;
}

//protected methods

//private methods

//others
